/* 传递给父组件select(value)事件
  接受父组件的options数组，格式为：
  options: [
    {
      label: '打折',
      value: 'discount'
    },
    {
      label: '优惠金额',
      value: 'fullReduction'
    }
  ]
*/
import React, { Component } from 'react'
import { Select } from 'element-react'

class Selects extends Component {
  constructor(props) {
    super(props)
    this.state = {
    }
  }
  
  render() {
    return (
      <div className="Select">
        <Select value={this.props.value} onChange={this.props.select}>
          {
            this.props.options.map((el, index) => {
              return <Select.Option key={index} label={el.label} value={el.value} />
            })
          }
        </Select>
      </div>
    );
  }
}

export default Selects;
